package day03;

public class Homework1 {
    public static void main(String[] args) {
        //1
        /*
        System.out.println(1%2);//1
        System.out.println(4%2);//0
        System.out.println(5%2);//1
        System.out.println("----------");
        int a=1,b=2;
        a++;
        b--;
        System.out.println(a);//2
        System.out.println(b);//1
        System.out.println("--------");
        int c=a++;
        int d=--b;
        System.out.println(a);//3
        System.out.println(c);//2
        System.out.println(b);//0
        System.out.println(d);//0

         */
        //2
        /*
        int a=5,b=10,c=5;
        boolean b1=b>a;
        System.out.println(b1);//t
        System.out.println(a>=b);//f
        System.out.println(c<=b);//t
        System.out.println(a==c);//t
        System.out.println(a!=b);//t
        System.out.println(a+c==b);//t
        System.out.println(a==b/2);//t
        System.out.println(a%c==b%c);//t

         */
        //3
        /*
        int a=5,b=10,c=6;
        boolean b1 = b>a && b<c;
        System.out.println(b1);//f
        System.out.println(a>c && b>c);//f
        System.out.println(a*c<b*c && a*b>a*c);//t
        System.out.println(a%c==b%c && c%b==c%a);//f
        System.out.println("-----------");
        System.out.println(a<b || a>c);//t
        System.out.println(a==c || a!=b);//t
        System.out.println(a+c>b || a+b>c);//t
        System.out.println(a*b>c*b || a*c>a*b);//f
        System.out.println("-----------");
        boolean b2 = !(a<b);
        boolean b3 = !(a>c);
        System.out.println(b2);
        System.out.println(b3);
        int d=5,e=10,f=5;
        boolean b4 = d>e && f++>2;
        System.out.println(b4);//f
        System.out.println(f);//5短路f++被跳过
        boolean b5 = d<e || f++>2;
        System.out.println(f);//5

         */
        //4
        /*
        int a = 5;
        a += 2;
        System.out.println(a);//7
        a -= 2;
        System.out.println(a);//5
        a *= 2;
        System.out.println(a);//10
        a /= 2;
        System.out.println(a);//5
        a %= 2;
        System.out.println(a);//1
        System.out.println("------------");
        short s = 5;
        s += 10;//15
        System.out.println(s);
        s=(short)(s+10);//25
        System.out.println(s);

         */
        //5
        /*
        int age = 20;
        String name = "Tom";
        System.out.println("age is "+age);
        System.out.println("name is "+name);
        System.out.println("name is "+name+" and age is "+age);
        System.out.println("-------同化作用---------");
        System.out.println(10+20+""+30);//3030
        System.out.println(10+""+20+30);//102030
        System.out.println(""+10+20+30);//102030
        System.out.println(10+20+30+"");//60

         */
        //6
        /*
        int num=5;
        int flag=num>0?1:0;
        System.out.println(flag);//1
        int a=2,b=3;
        int flag1=a>b?a:b;
        System.out.println(flag1);//3

         */
        //7
        /*
        int price=600;
        if (price>=500){
            price *= 0.8;
        }
        System.out.println(price);//480
        int score = 60;
        if (score>=0 && score<=100){
            System.out.println("成绩合法,成绩为"+score);//√
        }else{
            System.out.println("成绩不合法请重新输入");

         */
        //8
        /*
        int price = 600;
        if (price>=500){
            price *= 0.8;
        }else {
            price *= 0.9;
        }
        System.out.println("最终价格为"+price);

         */
        //9
        /*
        int price = 3000;
        if (price>=2000){
            price *= 0.5;
        } else if (price>=1000) {
            price *= 0.7;
        } else if (price>=500) {
            price *= 0.8;
        }else {
            price *= 0.9;
        }
        System.out.println("最终价格为"+price);

         */
    }
}
